package shuai.model;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.stereotype.Component;

@Component("u")
public class User {
	private String name;
	private int age;
	
	@PostConstruct
	//次注解的方法将在类实例化后调用
	public void init(){
		System.out.println("初始化的时候执行");
	}
	@PreDestroy
	//将在类销毁之前调用
	public void de(){
		System.out.println("销毁的时候执行");
	}
	
	public void printInto(){
		System.out.println("我是"+name+"，今年"+age);
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	
}
